//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mapper;

import com.example.entity.Activity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ActivityMapper {
    List<Activity> selectAll(Activity activity);

    Activity selectById(Integer id);

    @Insert({"insert into activity (club_id,activityapplication_id,title,descr,activity_type,start_time,end_time,location) values (#{clubId},#{activityapplicationId},#{title},#{descr},#{activityType},#{startTime},#{endTime},#{location})"})
    int insert(Activity activity);

    @Update({"update activity set club_id = #{clubId}, activityapplication_id = #{activityapplicationId},title = #{title},descr = #{descr},activity_type = #{activityType},start_time = #{startTime},end_time = #{endTime},location = #{location} where id=#{id}"})
    int updateById(Activity activity);

    @Delete({"delete from activity where id = #{id}"})
    int deleteById(Integer id);

    List<Activity> selectByPresidentId(Activity activity,Integer presidentId);
}
